package com.learning.fastjson;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.learning.bean.Person;

public class FastJson1 {
	public static void main(String[] args) {
		String src = "{ 'person':{'name':'Bill' , 'age':25}}";
		String src2 = "{'name':'Bill' , 'age':25}";
		JSONObject object = JSON.parseObject(src);
        p(object);
//        p(object.get("person"));
//        Person p=object.getObject("person", Person.class);
        Person p=JSON.parseObject(src2, Person.class);
        p(p);
	}

	static void p(Object o) {
		System.out.println(o);
	}
}
